package com.yanfan.iot.mapper;

import com.yanfan.iot.domain.FirmwareTaskDetail;
import com.yanfan.iot.model.FirmwareTaskDetailInput;
import com.yanfan.iot.model.FirmwareTaskDetailOutput;
import com.yanfan.iot.model.FirmwareTaskDeviceStatistic;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 固件升级任务详细Mapper接口
 *
 * @author kerwincui
 * @date 2022-10-24
 */
@Repository
public interface FirmwareTaskDetailMapper {
    /**
     * 查询固件升级任务详细
     *
     * @param id 固件升级任务详细主键
     * @return 固件升级任务详细
     */
    FirmwareTaskDetail selectFirmwareTaskDetailById(Long id);

    /**
     * 查询固件升级任务详细列表
     *
     * @param firmwareTaskDetail 固件升级任务详细
     * @return 固件升级任务详细集合
     */
    List<FirmwareTaskDetail> selectFirmwareTaskDetailList(FirmwareTaskDetail firmwareTaskDetail);

    /**
     * 根据固件id查询下属设备列表
     *
     * @param firmwareTaskDetailInput
     * @return
     */
    List<FirmwareTaskDetailOutput> selectFirmwareTaskDetailListByFirmwareId(FirmwareTaskDetailInput firmwareTaskDetailInput);

    /**
     * 查询固件升级任务详细列表-关联出固件信息
     *
     * @param firmwareTaskDetail 固件升级任务详细
     * @return 固件升级任务详细集合
     */
    List<FirmwareTaskDetail> selectFirmwareALLDetailList(FirmwareTaskDetail firmwareTaskDetail);

    /**
     * 新增固件升级任务详细
     *
     * @param firmwareTaskDetail 固件升级任务详细
     * @return 结果
     */
    int insertFirmwareTaskDetail(FirmwareTaskDetail firmwareTaskDetail);

    /**
     * 修改固件升级任务详细
     *
     * @param firmwareTaskDetail 固件升级任务详细
     * @return 结果
     */
    int updateFirmwareTaskDetail(FirmwareTaskDetail firmwareTaskDetail);

    /**
     * 删除固件升级任务详细
     *
     * @param id 固件升级任务详细主键
     * @return 结果
     */
    int deleteFirmwareTaskDetailById(Long id);

    /**
     * 批量删除固件升级任务详细
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    int deleteFirmwareTaskDetailByIds(Long[] ids);

    /**
     * 批量插入任务明细
     *
     * @param detailList
     * @return
     */
    int insertBatchFirmwareTaskDetail(List<FirmwareTaskDetail> detailList);

    /**
     * 固件升级设备统计
     *
     * @param firmwareTaskDetailInput
     * @return
     */
    List<FirmwareTaskDeviceStatistic> deviceStatistic(FirmwareTaskDetailInput firmwareTaskDetailInput);

}
